USE [CTEM-DB-v1]
GO

/****** Object:  StoredProcedure [dbo].[WorkerSalary_Update]    Script Date: 02/10/2012 11:13:56 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



-- =============================================
-- Author:		TienDH
-- Create date: 12/05/2011
-- Description:	Get full employee's information
-- =============================================
CREATE PROCEDURE [dbo].[WorkerSalary_Update]
    @workersSalaryID        bigint,
	@constructionID			bigint,
	@name					NVARCHAR(225),
	@fromDate				DateTime,
	@toDate					DateTime,
	@Task					NVARCHAR(MAX),
	@totalSalary			decimal(18, 0),
	@updatedBy				nvarchar(50),
	@OthersCost				bigint,
	@TotalCost				bigint,
	@Manager				NVARCHAR(50),
	@Reason					NVARCHAR(225)
AS
	DECLARE @lastUpdate	DATETIME
    SET     @lastUpdate = GETDATE()
BEGIN
	UPDATE  [WorkersSalary]
			
	SET      ConstructionID = @constructionID,
			Name = @name,
			FromDate = @fromDate,
			ToDate = @toDate,
			Task = @Task,
			TotalSalary =@totalSalary,
			LastUpdate=@lastUpdate,
			UpdatedBy=@updatedBy,
			OthersCost = @OthersCost,
			TotalCost = @TotalCost,
			Manager = @Manager,
			Reason = @Reason
	WHERE	WorkersSalaryID = @workersSalaryID
END



GO

